package acwing._2LanQiao._8NumberTheory;

/**
 * @Project : AlgorithmLearning
 * @Package : ACWing._2LanQiao._8numberTheory
 * @File : Q1246.java
 * @Author : WangRuoyu
 * @Date 2023/3/20 23:06
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Q1246 {

    static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] words = br.readLine().split(" ");
        int n = Integer.parseInt(words[0]);

        int[] a = new int[n];

        words = br.readLine().split(" ");
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(words[i]);
        }

        Arrays.sort(a);

        int d = a[1] - a[0];
        if (d == 0) {
            System.out.println(n);
            return;
        } else if (d == 1) {
            System.out.println((a[n - 1] - a[0]) / d + 1);
            return;
        }

        for (int i = 2; i < n; i++) {
            if (a[i] - a[0] == 0) {
                System.out.println(n);
                return;
            }
            d = gcd(d, a[i] - a[0]);
            if (d == 1) {
                break;
            }
        }
        System.out.println((a[n - 1] - a[0]) / d + 1);
    }
}
